﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace MwTUpdater
{
    public partial class DataConn : Form
    {
        public DataConn()
        {
            InitializeComponent();
        }

        public string[] ConnectionData = new string[4];

        private void button1_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(text_server.Text))
            {
                MessageBox.Show("Please type in a server", "Info");
                text_server.Focus();
                return;
            }

            if (string.IsNullOrEmpty(text_username.Text))
            {
                MessageBox.Show("Please type in a username", "Info");
                text_username.Focus();
                return;
            }

            if (string.IsNullOrEmpty(text_password.Text))
            {
                MessageBox.Show("Please type in a password", "Info");
                text_password.Focus();
                return;
            }


            if (string.IsNullOrEmpty(text_databasename.Text))
            {
                MessageBox.Show("Please type in a databasename", "Info");
                text_databasename.Focus();
                return;
            }

            ConnectionData[0] = text_server.Text;
            ConnectionData[1] = text_username.Text;
            ConnectionData[2] = text_password.Text;
            ConnectionData[3] = text_databasename.Text;

            this.Close();
        }

    }
}
